<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page import="java.util.*,java.io.*,nidea.*,java.math.BigInteger" session="true" contentType="text/html" pageEncoding="UTF-8"%>
<head>
    <title>Cambiar_creativo</title>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
    <link rel="stylesheet" type="text/css" href="style.css" />
</head>
<script language="JavaScript">
        var nav4 = window.Event ? true : false;
        function acceptNum(evt)
        {
            var key = nav4 ? evt.which : evt.keyCode;
            return (key <= 13 || key >= 48 && key <= 57);
        }
    </script>
<body>
    <div id="wrapper">
        <div id="top">
        </div>
        <div id="content">
            <div id="header">
                <img src= "header3" width=" " height=" ">
            </div>
            <div id="menu">
                <ul>
                    <li><a href="Pagina_inicio_creativo.jsp">Página inicio</a></li>
                    <li><a href="Consultar_creativo.jsp">Consultar creativo</a></li>
                    <li><a href="Baja_creativo.jsp" onclick="return confirm('Todos sus datos seran borrados desea continuar?');">Baja del creativo</a></li>
                    <li><a href="buscar_ideas_o_problemas.jsp">Buscar ideas o problemas</a></li>
                    <li><a href="Administrar_idea.jsp">Administrar idea</a></li>
                    <li><a href="cerrando.jsp">Salir</a></li>
                    
                </ul>
            </div>
            <div id="stuff">
                <center><h2> CAMBIAR INFORMACIÓN</h2> </center><br><br>                
                <%if (request.getParameter("error") != null) {%>
                <center>
                    <font color="red">
                        <b><%out.println(request.getParameter("error"));%></b>
                    </font>
                </center>
                <%}%>
                <%!    Creativo c = new Creativo();
                %>
                <%
            int ide = Integer.parseInt((String)request.getSession().getAttribute("id_creativo"));
            Creativo id = c.consultarCreativo(ide);
                %>
                <form action="Cambio_creativo.jsp" method="post">
                    <table border="0" align="center">
                        <tbody>                                        
                            <tr>
                                <td>Nombre(s): *</td>
                                <td><input type ="text" default value = "<%= id.getNombre()%>" size ="15" maxlength = "25" name="nombre"></td>
                            </tr>
                            <tr>
                                <td>Apellidos: *</td>
                                <td><input type ="text" default value = "<%= id.getApellidos()%>" size ="20" maxlength = "35" name = "apellidos"></td>
                            </tr>
                            <tr>
                                <td>País:</td>
                                <td><input type ="text" default value = "<%= id.getPais()%>" size ="15" maxlength = "15" name = "pais"></td>
                            </tr>
                            <tr>
                                <td>Dirección:</td>
                                <td><input type ="text" default value = "<%= id.getDireccion()%>" size ="30" maxlength = "50" name = "direccion"></td>
                            </tr>
                            <tr>                                
                                <td>Código Postal:</td>
                                <% if(id.getCodPostal() == -1){%>
                                <td><input type ="text" onKeyPress="return acceptNum(event)" size ="12" maxlength = "12" name = "codPostal"> </td>
                                <%} else{%>
                                <td><input type ="text" onKeyPress="return acceptNum(event)" default value = "<%= id.getCodPostal()%>" size ="12" maxlength = "12" name = "codPostal"> </td>
                                <%}%>                                
                            </tr>
                            <tr>                                
                                <td>Teléfono(casa): </td>
                                <% if(id.getTelCasa()== -1){%>
                                <td><input type ="text" onKeyPress="return acceptNum(event)" size ="13" maxlength = "13" name = "telCasa"></td>
                                <%} else{%>
                                <td><input type ="text" onKeyPress="return acceptNum(event)" default value = "<%= id.getTelCasa()%>" size ="13" maxlength = "13" name = "telCasa"></td>
                                <%}%>                                
                            </tr>
                            <tr>
                                <td>Teléfono (celular):</td>
                                <% if(id.getTelCel().equals(BigInteger.ZERO)){%>
                                <td><input type ="text" onKeyPress="return acceptNum(event)" size ="15" maxlength = "15" name = "telCel"></td>
                                <%} else{%>
                                <td><input type ="text" onKeyPress="return acceptNum(event)" default value = "<%= id.getTelCel()%>" size ="15" maxlength = "15" name = "telCel"></td>
                                <%}%>
                            </tr>
                            <tr>
                                <td>Correo electrónico: *</td>
                                <td><input type ="text" default value = "<%= id.getCorreo()%>" size ="30" maxlength = "40" name = "correo"></td>                                            
                            </tr>
                            <tr>
                            <td>Usuario: </td>
                            <td><%= id.getUsuario()%></td>
                            <tr>
                                <td>Contraseña: *</td>
                                <td><input type ="password" default value = "<%= id.getContrasena()%>" size ="15" maxlength = "20" name = "contra1"></td>                                            
                            </tr>
                            <tr>
                                <td>Repite la contraseña: *</td>
                                <td><input type ="password" default value = "<%= id.getContrasena()%>" size ="15" maxlength = "20" name = "contra2"></td>                                            
                            </tr>
                            <tr>
                                <td><input type="submit" value="Cambiar Datos"></td>
                                <td><input type ="reset" value = "Limpiar datos"></td>
                            </tr>
                        </tbody>
                    </table>
                </form>
                <br /><br />
            </div>
        </div>
        <div id="bottom">
        </div>
    </div>
</body>
</html>